﻿Imports System
Imports System.Collections.Generic
Imports System.Configuration
Imports System.Xml
Imports System.Xml.Serialization

Namespace System.Workflow.ComponentModel.Compiler
    Friend NotInheritable Class AuthorizedTypesSectionHandler
        Implements IConfigurationSectionHandler
        ' Methods
        Private Function System.Configuration.IConfigurationSectionHandler.Create(ByVal parent As Object, ByVal configContext As Object, ByVal section As XmlNode) As Object Implements IConfigurationSectionHandler.Create
            Dim list As New List([Of] AuthorizedType)
            Dim serializer As XmlSerializer = Nothing
            serializer = New XmlSerializer(GetType(AuthorizedType))
            Dim node As XmlNode
            For Each node In section.ChildNodes
                Dim item As AuthorizedType = [TryCast](serializer.Deserialize(New XmlNodeReader(node)),AuthorizedType)
                If (Not item Is Nothing) Then
                    list.Add(item)
                End If
            Next
            Return list
        End Function

    End Class
End Namespace

